/* Copyright 2019 Maxence Thevenet
 *
 * This file is part of WarpX.
 *
 * License: BSD-3-Clause-LBNL
 */
#include <AMReX_AmrCore.H>
#include <AMReX_REAL.H>

#ifndef WARPX_GODFREY_COEFF_TABLE_H_
#define WARPX_GODFREY_COEFF_TABLE_H_

namespace warpx
{
namespace nci_godfrey
{
    using namespace amrex::literals;

    // Table width. This is related to the stencil length
    const int tab_width = 4;
    // table length. Each line correspond to 1 value of cdtodz
    // (here 101 values).
    const int tab_length = 101;

    // Table of coefficient for Ex, Ey and Bz for Galerkin gather.
    // Each line stands for one value of c*dt/dz, between 0 and 1.
    // We typically interpolate between two lines.

    const amrex::Real table_nci_godfrey_galerkin_Ex_Ey_Bz[tab_length][tab_width]{
        {-2.47536_rt,2.04288_rt,-0.598163_rt,0.0314711_rt},
        {-2.47536_rt,2.04288_rt,-0.598163_rt,0.0314711_rt},
        {-2.47545_rt,2.04309_rt,-0.598307_rt,0.0315029_rt},
        {-2.4756_rt,2.04342_rt,-0.598549_rt,0.0315558_rt},
        {-2.47581_rt,2.0439_rt,-0.598886_rt,0.0316298_rt},
        {-2.47608_rt,2.0445_rt,-0.59932_rt,0.031725_rt},
        {-2.47641_rt,2.04525_rt,-0.59985_rt,0.0318412_rt},
        {-2.4768_rt,2.04612_rt,-0.600477_rt,0.0319785_rt},
        {-2.47725_rt,2.04714_rt,-0.6012_rt,0.0321367_rt},
        {-2.47776_rt,2.04829_rt,-0.602019_rt,0.0323158_rt},
        {-2.47833_rt,2.04957_rt,-0.602934_rt,0.0325158_rt},
        {-2.47896_rt,2.05099_rt,-0.603944_rt,0.0327364_rt},
        {-2.47965_rt,2.05254_rt,-0.605051_rt,0.0329777_rt},
        {-2.4804_rt,2.05423_rt,-0.606253_rt,0.0332396_rt},
        {-2.48121_rt,2.05606_rt,-0.60755_rt,0.0335218_rt},
        {-2.48208_rt,2.05802_rt,-0.608942_rt,0.0338243_rt},
        {-2.48301_rt,2.06012_rt,-0.610429_rt,0.0341469_rt},
        {-2.48401_rt,2.06235_rt,-0.61201_rt,0.0344895_rt},
        {-2.48506_rt,2.06471_rt,-0.613685_rt,0.0348519_rt},
        {-2.48618_rt,2.06721_rt,-0.615453_rt,0.0352339_rt},
        {-2.48735_rt,2.06984_rt,-0.617314_rt,0.0356353_rt},
        {-2.48859_rt,2.07261_rt,-0.619268_rt,0.0360559_rt},
        {-2.48988_rt,2.0755_rt,-0.621312_rt,0.0364954_rt},
        {-2.49123_rt,2.07853_rt,-0.623447_rt,0.0369536_rt},
        {-2.49265_rt,2.08169_rt,-0.625672_rt,0.0374302_rt},
        {-2.49412_rt,2.08498_rt,-0.627986_rt,0.0379248_rt},
        {-2.49565_rt,2.0884_rt,-0.630386_rt,0.0384372_rt},
        {-2.49724_rt,2.09194_rt,-0.632873_rt,0.0389669_rt},
        {-2.49888_rt,2.09561_rt,-0.635443_rt,0.0395135_rt},
        {-2.50058_rt,2.09939_rt,-0.638096_rt,0.0400766_rt},
        {-2.50234_rt,2.1033_rt,-0.640829_rt,0.0406557_rt},
        {-2.50415_rt,2.10732_rt,-0.64364_rt,0.0412502_rt},
        {-2.50601_rt,2.11145_rt,-0.646526_rt,0.0418594_rt},
        {-2.50791_rt,2.1157_rt,-0.649485_rt,0.0424828_rt},
        {-2.50987_rt,2.12004_rt,-0.652512_rt,0.0431196_rt},
        {-2.51187_rt,2.12448_rt,-0.655604_rt,0.0437688_rt},
        {-2.51392_rt,2.12901_rt,-0.658756_rt,0.0444297_rt},
        {-2.516_rt,2.13363_rt,-0.661964_rt,0.0451011_rt},
        {-2.51812_rt,2.13832_rt,-0.665221_rt,0.0457818_rt},
        {-2.52027_rt,2.14308_rt,-0.668521_rt,0.0464705_rt},
        {-2.52244_rt,2.14789_rt,-0.671856_rt,0.0471658_rt},
        {-2.52464_rt,2.15274_rt,-0.675218_rt,0.0478658_rt},
        {-2.52684_rt,2.15762_rt,-0.678596_rt,0.0485687_rt},
        {-2.52906_rt,2.16251_rt,-0.68198_rt,0.0492723_rt},
        {-2.53126_rt,2.16738_rt,-0.685355_rt,0.049974_rt},
        {-2.53345_rt,2.17222_rt,-0.688706_rt,0.0506708_rt},
        {-2.53561_rt,2.177_rt,-0.692015_rt,0.0513594_rt},
        {-2.53773_rt,2.18168_rt,-0.69526_rt,0.0520359_rt},
        {-2.53978_rt,2.18623_rt,-0.698416_rt,0.0526955_rt},
        {-2.54175_rt,2.19059_rt,-0.701452_rt,0.053333_rt},
        {-2.5436_rt,2.19471_rt,-0.704331_rt,0.0539417_rt},
        {-2.54531_rt,2.19852_rt,-0.70701_rt,0.0545141_rt},
        {-2.54683_rt,2.20193_rt,-0.709433_rt,0.0550409_rt},
        {-2.5481_rt,2.20483_rt,-0.711533_rt,0.0555106_rt},
        {-2.54906_rt,2.20709_rt,-0.713224_rt,0.0559094_rt},
        {-2.54963_rt,2.20852_rt,-0.714397_rt,0.0562198_rt},
        {-2.54968_rt,2.20888_rt,-0.714907_rt,0.0564196_rt},
        {-2.54905_rt,2.20785_rt,-0.714562_rt,0.0564797_rt},
        {-2.54751_rt,2.20496_rt,-0.713094_rt,0.0563618_rt},
        {-2.54472_rt,2.19955_rt,-0.710118_rt,0.0560124_rt},
        {-2.54014_rt,2.19058_rt,-0.705048_rt,0.0553544_rt},
        {-2.53286_rt,2.1763_rt,-0.69693_rt,0.0542684_rt},
        {-2.52115_rt,2.15344_rt,-0.684027_rt,0.05255_rt},
        {-2.50098_rt,2.11466_rt,-0.66255_rt,0.0497817_rt},
        {-2.45797_rt,2.03459_rt,-0.620099_rt,0.0446889_rt},
        {-2.28371_rt,1.72254_rt,-0.465905_rt,0.0283268_rt},
        {-2.4885_rt,2.04899_rt,-0.599292_rt,0.0390466_rt},
        {-2.1433_rt,1.36735_rt,-0.220924_rt,-0.00215633_rt},
        {-2.4943_rt,2.07019_rt,-0.610552_rt,0.035166_rt},
        {-2.84529_rt,2.77303_rt,-1.00018_rt,0.0724884_rt},
        {-2.72242_rt,2.51888_rt,-0.847226_rt,0.0509964_rt},
        {-2.65633_rt,2.3744_rt,-0.750392_rt,0.0326366_rt},
        {-2.59601_rt,2.23412_rt,-0.646421_rt,0.00868027_rt},
        {-2.51477_rt,2.0369_rt,-0.491066_rt,-0.0306397_rt},
        {-2.35935_rt,1.65155_rt,-0.178971_rt,-0.112713_rt},
        {-1.84315_rt,0.361693_rt,0.876104_rt,-0.393844_rt},
        {-2.65422_rt,2.39262_rt,-0.789663_rt,0.0516265_rt},
        {-3.46529_rt,4.42354_rt,-2.45543_rt,0.497097_rt},
        {-3.15747_rt,3.65311_rt,-1.824_rt,0.328432_rt},
        {-3.04694_rt,3.37613_rt,-1.59668_rt,0.267631_rt},
        {-2.99205_rt,3.23814_rt,-1.48302_rt,0.237103_rt},
        {-2.96075_rt,3.15894_rt,-1.41733_rt,0.219317_rt},
        {-2.94172_rt,3.11028_rt,-1.37649_rt,0.20811_rt},
        {-2.92994_rt,3.07962_rt,-1.35025_rt,0.200755_rt},
        {-2.92283_rt,3.06054_rt,-1.33338_rt,0.195859_rt},
        {-2.91894_rt,3.04938_rt,-1.3229_rt,0.192637_rt},
        {-2.91736_rt,3.04394_rt,-1.31702_rt,0.190612_rt},
        {-2.91753_rt,3.04278_rt,-1.31456_rt,0.189477_rt},
        {-2.91905_rt,3.04494_rt,-1.31475_rt,0.189026_rt},
        {-2.92165_rt,3.04973_rt,-1.31705_rt,0.189117_rt},
        {-2.92512_rt,3.05667_rt,-1.32105_rt,0.189646_rt},
        {-2.92933_rt,3.06539_rt,-1.32646_rt,0.190538_rt},
        {-2.93416_rt,3.07562_rt,-1.33308_rt,0.191735_rt},
        {-2.93952_rt,3.08715_rt,-1.34072_rt,0.193194_rt},
        {-2.94535_rt,3.09982_rt,-1.34925_rt,0.194881_rt},
        {-2.95159_rt,3.11349_rt,-1.35858_rt,0.196769_rt},
        {-2.9582_rt,3.12805_rt,-1.36861_rt,0.198838_rt},
        {-2.96514_rt,3.14342_rt,-1.37929_rt,0.201068_rt},
        {-2.97239_rt,3.15953_rt,-1.39055_rt,0.203448_rt},
        {-2.97991_rt,3.17632_rt,-1.40234_rt,0.205964_rt},
        {-2.98769_rt,3.19374_rt,-1.41463_rt,0.208607_rt}
    };

    // Table of coefficient for Bx, By and Ez for Galerkin gather.
    // Each line stands for one value of c*dt/dz, between 0 and 1.
    // We typically interpolate between two lines.
    const amrex::Real table_nci_godfrey_galerkin_Bx_By_Ez[tab_length][tab_width]{
        {-2.80862_rt,2.80104_rt,-1.14615_rt,0.154077_rt},
        {-2.80862_rt,2.80104_rt,-1.14615_rt,0.154077_rt},
        {-2.80851_rt,2.80078_rt,-1.14595_rt,0.154027_rt},
        {-2.80832_rt,2.80034_rt,-1.14561_rt,0.153945_rt},
        {-2.80807_rt,2.79973_rt,-1.14514_rt,0.153829_rt},
        {-2.80774_rt,2.79894_rt,-1.14454_rt,0.15368_rt},
        {-2.80733_rt,2.79798_rt,-1.1438_rt,0.153498_rt},
        {-2.80685_rt,2.79685_rt,-1.14292_rt,0.153284_rt},
        {-2.8063_rt,2.79554_rt,-1.14192_rt,0.153036_rt},
        {-2.80568_rt,2.79405_rt,-1.14077_rt,0.152756_rt},
        {-2.80498_rt,2.79239_rt,-1.1395_rt,0.152443_rt},
        {-2.80421_rt,2.79056_rt,-1.13809_rt,0.152098_rt},
        {-2.80337_rt,2.78856_rt,-1.13656_rt,0.151721_rt},
        {-2.80246_rt,2.78638_rt,-1.13488_rt,0.151312_rt},
        {-2.80147_rt,2.78404_rt,-1.13308_rt,0.150871_rt},
        {-2.80041_rt,2.78152_rt,-1.13115_rt,0.150397_rt},
        {-2.79927_rt,2.77882_rt,-1.12908_rt,0.149893_rt},
        {-2.79807_rt,2.77596_rt,-1.12689_rt,0.149356_rt},
        {-2.79679_rt,2.77292_rt,-1.12456_rt,0.148789_rt},
        {-2.79543_rt,2.76972_rt,-1.12211_rt,0.14819_rt},
        {-2.79401_rt,2.76634_rt,-1.11953_rt,0.14756_rt},
        {-2.79251_rt,2.76279_rt,-1.11681_rt,0.1469_rt},
        {-2.79094_rt,2.75907_rt,-1.11397_rt,0.146208_rt},
        {-2.78929_rt,2.75517_rt,-1.111_rt,0.145486_rt},
        {-2.78757_rt,2.7511_rt,-1.10789_rt,0.144733_rt},
        {-2.78578_rt,2.74686_rt,-1.10466_rt,0.14395_rt},
        {-2.78391_rt,2.74245_rt,-1.1013_rt,0.143137_rt},
        {-2.78196_rt,2.73786_rt,-1.09781_rt,0.142293_rt},
        {-2.77994_rt,2.73309_rt,-1.09419_rt,0.141419_rt},
        {-2.77784_rt,2.72814_rt,-1.09043_rt,0.140514_rt},
        {-2.77566_rt,2.72301_rt,-1.08654_rt,0.139578_rt},
        {-2.7734_rt,2.7177_rt,-1.08252_rt,0.138612_rt},
        {-2.77106_rt,2.7122_rt,-1.07836_rt,0.137614_rt},
        {-2.76864_rt,2.70651_rt,-1.07406_rt,0.136586_rt},
        {-2.76613_rt,2.70062_rt,-1.06962_rt,0.135525_rt},
        {-2.76353_rt,2.69453_rt,-1.06503_rt,0.134432_rt},
        {-2.76084_rt,2.68824_rt,-1.0603_rt,0.133307_rt},
        {-2.75806_rt,2.68173_rt,-1.05541_rt,0.132148_rt},
        {-2.75518_rt,2.675_rt,-1.05037_rt,0.130954_rt},
        {-2.75219_rt,2.66804_rt,-1.04516_rt,0.129725_rt},
        {-2.7491_rt,2.66084_rt,-1.03978_rt,0.12846_rt},
        {-2.7459_rt,2.65339_rt,-1.03423_rt,0.127156_rt},
        {-2.74257_rt,2.64566_rt,-1.02848_rt,0.125813_rt},
        {-2.73912_rt,2.63765_rt,-1.02254_rt,0.124428_rt},
        {-2.73552_rt,2.62934_rt,-1.01638_rt,0.122999_rt},
        {-2.73178_rt,2.62069_rt,-1.01_rt,0.121523_rt},
        {-2.72787_rt,2.61169_rt,-1.00337_rt,0.119996_rt},
        {-2.72379_rt,2.6023_rt,-0.996479_rt,0.118417_rt},
        {-2.71951_rt,2.59248_rt,-0.989294_rt,0.116778_rt},
        {-2.71501_rt,2.58218_rt,-0.981786_rt,0.115076_rt},
        {-2.71026_rt,2.57135_rt,-0.97392_rt,0.113303_rt},
        {-2.70524_rt,2.55991_rt,-0.965651_rt,0.111453_rt},
        {-2.69989_rt,2.54778_rt,-0.956922_rt,0.109514_rt},
        {-2.69416_rt,2.53484_rt,-0.947666_rt,0.107476_rt},
        {-2.68799_rt,2.52096_rt,-0.937795_rt,0.105324_rt},
        {-2.68129_rt,2.50596_rt,-0.927197_rt,0.103039_rt},
        {-2.67394_rt,2.48959_rt,-0.915724_rt,0.100597_rt},
        {-2.66578_rt,2.47153_rt,-0.903179_rt,0.097968_rt},
        {-2.65657_rt,2.4513_rt,-0.889283_rt,0.0951084_rt},
        {-2.64598_rt,2.42824_rt,-0.873638_rt,0.0919592_rt},
        {-2.63347_rt,2.40127_rt,-0.855632_rt,0.0884325_rt},
        {-2.61813_rt,2.36864_rt,-0.834261_rt,0.0843898_rt},
        {-2.59821_rt,2.32701_rt,-0.807691_rt,0.0795876_rt},
        {-2.56971_rt,2.26887_rt,-0.77188_rt,0.0735132_rt},
        {-2.51823_rt,2.16823_rt,-0.713448_rt,0.0645399_rt},
        {-2.33537_rt,1.8294_rt,-0.533852_rt,0.0409941_rt},
        {-2.53143_rt,2.14818_rt,-0.670502_rt,0.053982_rt},
        {-2.17737_rt,1.43641_rt,-0.259095_rt,0.00101255_rt},
        {-2.51929_rt,2.12931_rt,-0.654743_rt,0.0452381_rt},
        {-2.86122_rt,2.82221_rt,-1.05039_rt,0.0894636_rt},
        {-2.72908_rt,2.54506_rt,-0.87834_rt,0.0626188_rt},
        {-2.6536_rt,2.37954_rt,-0.7665_rt,0.0409117_rt},
        {-2.58374_rt,2.21923_rt,-0.649738_rt,0.0146791_rt},
        {-2.49284_rt,2.00346_rt,-0.48457_rt,-0.0255348_rt},
        {-2.32762_rt,1.60337_rt,-0.1698_rt,-0.105287_rt},
        {-1.80149_rt,0.316787_rt,0.855414_rt,-0.369652_rt},
        {-2.60242_rt,2.28418_rt,-0.721378_rt,0.040091_rt},
        {-3.40335_rt,4.25157_rt,-2.29817_rt,0.449834_rt},
        {-3.0852_rt,3.47341_rt,-1.67791_rt,0.28982_rt},
        {-2.9642_rt,3.17856_rt,-1.44399_rt,0.229852_rt},
        {-2.89872_rt,3.01966_rt,-1.31861_rt,0.197945_rt},
        {-2.85668_rt,2.91811_rt,-1.23894_rt,0.17783_rt},
        {-2.82679_rt,2.84621_rt,-1.18287_rt,0.163785_rt},
        {-2.80401_rt,2.79167_rt,-1.14058_rt,0.153278_rt},
        {-2.78577_rt,2.74819_rt,-1.10706_rt,0.145015_rt},
        {-2.77061_rt,2.7122_rt,-1.07946_rt,0.138267_rt},
        {-2.75764_rt,2.68152_rt,-1.05606_rt,0.132589_rt},
        {-2.74627_rt,2.65475_rt,-1.03575_rt,0.127695_rt},
        {-2.73612_rt,2.63093_rt,-1.01777_rt,0.123395_rt},
        {-2.72692_rt,2.6094_rt,-1.00159_rt,0.119553_rt},
        {-2.71846_rt,2.58968_rt,-0.986841_rt,0.116074_rt},
        {-2.71061_rt,2.57142_rt,-0.973239_rt,0.112887_rt},
        {-2.70323_rt,2.55434_rt,-0.960573_rt,0.109937_rt},
        {-2.69626_rt,2.53824_rt,-0.948678_rt,0.107185_rt},
        {-2.68962_rt,2.52294_rt,-0.937429_rt,0.104598_rt},
        {-2.68327_rt,2.50833_rt,-0.926722_rt,0.102151_rt},
        {-2.67714_rt,2.4943_rt,-0.916477_rt,0.0998223_rt},
        {-2.67122_rt,2.48076_rt,-0.906627_rt,0.0975966_rt},
        {-2.66546_rt,2.46764_rt,-0.897118_rt,0.0954599_rt},
        {-2.65985_rt,2.45489_rt,-0.887903_rt,0.0934011_rt},
        {-2.65437_rt,2.44244_rt,-0.878945_rt,0.0914107_rt}
    };

    // Table of coefficient for Ex, Ey and Bz for momentum-conserving gather
    // (from node-centered fields).
    // Each line stands for one value of c*dt/dz, between 0 and 1.
    // We typically interpolate between two lines.
    const amrex::Real table_nci_godfrey_momentum_Ex_Ey_Bz[tab_length][tab_width]{
        {-2.98767_rt,3.19368_rt,-1.41458_rt,0.208594_rt},
        {-2.98767_rt,3.19368_rt,-1.41458_rt,0.208594_rt},
        {-2.9876_rt,3.19351_rt,-1.41444_rt,0.208555_rt},
        {-2.98749_rt,3.19323_rt,-1.41421_rt,0.208491_rt},
        {-2.98734_rt,3.19285_rt,-1.41388_rt,0.208402_rt},
        {-2.98716_rt,3.19237_rt,-1.41348_rt,0.20829_rt},
        {-2.98693_rt,3.19179_rt,-1.41299_rt,0.208157_rt},
        {-2.98668_rt,3.19114_rt,-1.41244_rt,0.208006_rt},
        {-2.98639_rt,3.19041_rt,-1.41183_rt,0.207837_rt},
        {-2.98608_rt,3.18962_rt,-1.41116_rt,0.207655_rt},
        {-2.98576_rt,3.18878_rt,-1.41046_rt,0.207463_rt},
        {-2.98542_rt,3.18791_rt,-1.40972_rt,0.207262_rt},
        {-2.98507_rt,3.18701_rt,-1.40898_rt,0.207058_rt},
        {-2.98472_rt,3.18612_rt,-1.40822_rt,0.206852_rt},
        {-2.98437_rt,3.18523_rt,-1.40748_rt,0.20665_rt},
        {-2.98403_rt,3.18437_rt,-1.40676_rt,0.206454_rt},
        {-2.98371_rt,3.18355_rt,-1.40608_rt,0.206269_rt},
        {-2.98341_rt,3.18279_rt,-1.40544_rt,0.206097_rt},
        {-2.98314_rt,3.1821_rt,-1.40487_rt,0.205943_rt},
        {-2.98291_rt,3.1815_rt,-1.40437_rt,0.20581_rt},
        {-2.98271_rt,3.181_rt,-1.40397_rt,0.205702_rt},
        {-2.98256_rt,3.18062_rt,-1.40366_rt,0.205622_rt},
        {-2.98246_rt,3.18037_rt,-1.40346_rt,0.205572_rt},
        {-2.98241_rt,3.18027_rt,-1.40339_rt,0.205557_rt},
        {-2.98243_rt,3.18033_rt,-1.40345_rt,0.20558_rt},
        {-2.98251_rt,3.18056_rt,-1.40366_rt,0.205642_rt},
        {-2.98267_rt,3.18097_rt,-1.40402_rt,0.205747_rt},
        {-2.9829_rt,3.18157_rt,-1.40455_rt,0.205896_rt},
        {-2.98321_rt,3.18238_rt,-1.40524_rt,0.206093_rt},
        {-2.9836_rt,3.1834_rt,-1.40612_rt,0.206339_rt},
        {-2.98407_rt,3.18465_rt,-1.40718_rt,0.206637_rt},
        {-2.98464_rt,3.18612_rt,-1.40844_rt,0.206987_rt},
        {-2.9853_rt,3.18783_rt,-1.40989_rt,0.207392_rt},
        {-2.98606_rt,3.18979_rt,-1.41156_rt,0.207853_rt},
        {-2.98691_rt,3.19199_rt,-1.41343_rt,0.208372_rt},
        {-2.98787_rt,3.19446_rt,-1.41551_rt,0.208948_rt},
        {-2.98892_rt,3.19718_rt,-1.41782_rt,0.209585_rt},
        {-2.99008_rt,3.20017_rt,-1.42034_rt,0.210281_rt},
        {-2.99135_rt,3.20343_rt,-1.42309_rt,0.211039_rt},
        {-2.99273_rt,3.20697_rt,-1.42608_rt,0.211859_rt},
        {-2.99421_rt,3.21078_rt,-1.42929_rt,0.212741_rt},
        {-2.9958_rt,3.21487_rt,-1.43273_rt,0.213686_rt},
        {-2.99751_rt,3.21925_rt,-1.43641_rt,0.214695_rt},
        {-2.99933_rt,3.22391_rt,-1.44033_rt,0.215767_rt},
        {-3.00126_rt,3.22886_rt,-1.44449_rt,0.216904_rt},
        {-3.0033_rt,3.2341_rt,-1.44888_rt,0.218105_rt},
        {-3.00546_rt,3.23964_rt,-1.45352_rt,0.219371_rt},
        {-3.00774_rt,3.24546_rt,-1.4584_rt,0.220701_rt},
        {-3.01013_rt,3.25158_rt,-1.46352_rt,0.222096_rt},
        {-3.01264_rt,3.25799_rt,-1.46888_rt,0.223557_rt},
        {-3.01526_rt,3.26469_rt,-1.47449_rt,0.225082_rt},
        {-3.018_rt,3.2717_rt,-1.48034_rt,0.226672_rt},
        {-3.02086_rt,3.279_rt,-1.48644_rt,0.228327_rt},
        {-3.02384_rt,3.28659_rt,-1.49278_rt,0.230048_rt},
        {-3.02694_rt,3.29449_rt,-1.49936_rt,0.231833_rt},
        {-3.03015_rt,3.30268_rt,-1.50619_rt,0.233684_rt},
        {-3.03348_rt,3.31117_rt,-1.51327_rt,0.2356_rt},
        {-3.03693_rt,3.31996_rt,-1.52059_rt,0.237581_rt},
        {-3.0405_rt,3.32904_rt,-1.52815_rt,0.239627_rt},
        {-3.04418_rt,3.33843_rt,-1.53596_rt,0.241738_rt},
        {-3.04799_rt,3.34812_rt,-1.54402_rt,0.243915_rt},
        {-3.05191_rt,3.3581_rt,-1.55232_rt,0.246156_rt},
        {-3.05596_rt,3.36838_rt,-1.56087_rt,0.248463_rt},
        {-3.06012_rt,3.37896_rt,-1.56966_rt,0.250835_rt},
        {-3.0644_rt,3.38984_rt,-1.5787_rt,0.253272_rt},
        {-3.0688_rt,3.40102_rt,-1.58798_rt,0.255774_rt},
        {-3.07332_rt,3.4125_rt,-1.59751_rt,0.258342_rt},
        {-3.07795_rt,3.42428_rt,-1.60729_rt,0.260976_rt},
        {-3.08271_rt,3.43636_rt,-1.61731_rt,0.263675_rt},
        {-3.08758_rt,3.44874_rt,-1.62758_rt,0.26644_rt},
        {-3.09257_rt,3.46142_rt,-1.6381_rt,0.269271_rt},
        {-3.09769_rt,3.47439_rt,-1.64886_rt,0.272168_rt},
        {-3.10292_rt,3.48767_rt,-1.65987_rt,0.275131_rt},
        {-3.10826_rt,3.50125_rt,-1.67113_rt,0.278161_rt},
        {-3.11373_rt,3.51513_rt,-1.68264_rt,0.281258_rt},
        {-3.11932_rt,3.52931_rt,-1.6944_rt,0.284421_rt},
        {-3.12502_rt,3.54379_rt,-1.7064_rt,0.287652_rt},
        {-3.13084_rt,3.55857_rt,-1.71866_rt,0.29095_rt},
        {-3.13678_rt,3.57365_rt,-1.73117_rt,0.294316_rt},
        {-3.14284_rt,3.58903_rt,-1.74393_rt,0.297751_rt},
        {-3.14902_rt,3.60472_rt,-1.75694_rt,0.301254_rt},
        {-3.15531_rt,3.6207_rt,-1.7702_rt,0.304825_rt},
        {-3.16173_rt,3.63699_rt,-1.78372_rt,0.308466_rt},
        {-3.16826_rt,3.65359_rt,-1.79749_rt,0.312177_rt},
        {-3.17491_rt,3.67048_rt,-1.81152_rt,0.315958_rt},
        {-3.18168_rt,3.68768_rt,-1.82581_rt,0.31981_rt},
        {-3.18856_rt,3.70519_rt,-1.84035_rt,0.323732_rt},
        {-3.19557_rt,3.72299_rt,-1.85515_rt,0.327726_rt},
        {-3.20269_rt,3.74111_rt,-1.8702_rt,0.331792_rt},
        {-3.20993_rt,3.75953_rt,-1.88552_rt,0.33593_rt},
        {-3.21729_rt,3.77825_rt,-1.9011_rt,0.340142_rt},
        {-3.22476_rt,3.79729_rt,-1.91694_rt,0.344427_rt},
        {-3.23236_rt,3.81662_rt,-1.93305_rt,0.348786_rt},
        {-3.24007_rt,3.83627_rt,-1.94942_rt,0.353221_rt},
        {-3.2479_rt,3.85623_rt,-1.96606_rt,0.35773_rt},
        {-3.25584_rt,3.87649_rt,-1.98296_rt,0.362316_rt},
        {-3.26391_rt,3.89706_rt,-2.00013_rt,0.366978_rt},
        {-3.27209_rt,3.91795_rt,-2.01758_rt,0.371718_rt},
        {-3.28039_rt,3.93914_rt,-2.03529_rt,0.376536_rt},
        {-3.2888_rt,3.96065_rt,-2.05328_rt,0.381432_rt},
        {-3.2888_rt,3.96065_rt,-2.05328_rt,0.381432_rt}
    };

    // Table of coefficient for Bx, By and Ez for momentum-conserving gather
    // (from node-centered fields).
    // Each line stands for one value of c*dt/dz, between 0 and 1.
    // We typically interpolate between two lines.
    const amrex::Real table_nci_godfrey_momentum_Bx_By_Ez[tab_length][tab_width]{
        {-2.65428_rt,2.44224_rt,-0.878796_rt,0.0913764_rt},
        {-2.65428_rt,2.44224_rt,-0.878796_rt,0.0913764_rt},
        {-2.65401_rt,2.44163_rt,-0.878347_rt,0.0912737_rt},
        {-2.65357_rt,2.44061_rt,-0.877602_rt,0.0911031_rt},
        {-2.65296_rt,2.43919_rt,-0.876563_rt,0.0908654_rt},
        {-2.65217_rt,2.43738_rt,-0.875236_rt,0.0905616_rt},
        {-2.65121_rt,2.43518_rt,-0.873624_rt,0.0901933_rt},
        {-2.65009_rt,2.43261_rt,-0.871736_rt,0.089762_rt},
        {-2.6488_rt,2.42966_rt,-0.869579_rt,0.0892697_rt},
        {-2.64736_rt,2.42635_rt,-0.86716_rt,0.0887186_rt},
        {-2.64577_rt,2.4227_rt,-0.86449_rt,0.088111_rt},
        {-2.64403_rt,2.41871_rt,-0.861579_rt,0.0874494_rt},
        {-2.64215_rt,2.4144_rt,-0.858436_rt,0.0867364_rt},
        {-2.64013_rt,2.40979_rt,-0.855074_rt,0.0859749_rt},
        {-2.63798_rt,2.40488_rt,-0.851503_rt,0.0851676_rt},
        {-2.63571_rt,2.39969_rt,-0.847734_rt,0.0843175_rt},
        {-2.63333_rt,2.39425_rt,-0.84378_rt,0.0834274_rt},
        {-2.63083_rt,2.38855_rt,-0.839652_rt,0.0825004_rt},
        {-2.62822_rt,2.38262_rt,-0.835361_rt,0.0815392_rt},
        {-2.62552_rt,2.37647_rt,-0.830918_rt,0.0805468_rt},
        {-2.62272_rt,2.37011_rt,-0.826336_rt,0.0795259_rt},
        {-2.61984_rt,2.36357_rt,-0.821624_rt,0.0784793_rt},
        {-2.61687_rt,2.35684_rt,-0.816793_rt,0.0774095_rt},
        {-2.61383_rt,2.34995_rt,-0.811854_rt,0.076319_rt},
        {-2.61071_rt,2.34291_rt,-0.806815_rt,0.0752104_rt},
        {-2.60753_rt,2.33573_rt,-0.801685_rt,0.0740857_rt},
        {-2.60428_rt,2.32842_rt,-0.796474_rt,0.0729473_rt},
        {-2.60098_rt,2.32098_rt,-0.791189_rt,0.0717971_rt},
        {-2.59762_rt,2.31344_rt,-0.785838_rt,0.070637_rt},
        {-2.59421_rt,2.3058_rt,-0.780428_rt,0.0694688_rt},
        {-2.59076_rt,2.29806_rt,-0.774966_rt,0.0682941_rt},
        {-2.58726_rt,2.29024_rt,-0.769458_rt,0.0671146_rt},
        {-2.58372_rt,2.28234_rt,-0.76391_rt,0.0659314_rt},
        {-2.58014_rt,2.27437_rt,-0.758326_rt,0.064746_rt},
        {-2.57653_rt,2.26633_rt,-0.752711_rt,0.0635596_rt},
        {-2.57288_rt,2.25824_rt,-0.74707_rt,0.0623731_rt},
        {-2.5692_rt,2.25009_rt,-0.741407_rt,0.0611876_rt},
        {-2.5655_rt,2.24189_rt,-0.735726_rt,0.060004_rt},
        {-2.56177_rt,2.23365_rt,-0.730029_rt,0.058823_rt},
        {-2.55801_rt,2.22537_rt,-0.724319_rt,0.0576454_rt},
        {-2.55422_rt,2.21704_rt,-0.7186_rt,0.0564718_rt},
        {-2.55042_rt,2.20869_rt,-0.712873_rt,0.0553027_rt},
        {-2.54659_rt,2.2003_rt,-0.707141_rt,0.0541387_rt},
        {-2.54274_rt,2.19188_rt,-0.701405_rt,0.0529802_rt},
        {-2.53887_rt,2.18343_rt,-0.695668_rt,0.0518276_rt},
        {-2.53498_rt,2.17496_rt,-0.68993_rt,0.0506813_rt},
        {-2.53108_rt,2.16647_rt,-0.684193_rt,0.0495415_rt},
        {-2.52715_rt,2.15795_rt,-0.678458_rt,0.0484085_rt},
        {-2.52321_rt,2.14941_rt,-0.672726_rt,0.0472826_rt},
        {-2.51925_rt,2.14085_rt,-0.666998_rt,0.0461638_rt},
        {-2.51528_rt,2.13227_rt,-0.661275_rt,0.0450525_rt},
        {-2.51129_rt,2.12367_rt,-0.655557_rt,0.0439488_rt},
        {-2.50728_rt,2.11506_rt,-0.649845_rt,0.0428526_rt},
        {-2.50326_rt,2.10642_rt,-0.644139_rt,0.0417643_rt},
        {-2.49922_rt,2.09778_rt,-0.63844_rt,0.0406838_rt},
        {-2.49516_rt,2.08911_rt,-0.632749_rt,0.0396112_rt},
        {-2.4911_rt,2.08043_rt,-0.627065_rt,0.0385466_rt},
        {-2.48701_rt,2.07174_rt,-0.621388_rt,0.03749_rt},
        {-2.48291_rt,2.06303_rt,-0.61572_rt,0.0364415_rt},
        {-2.4788_rt,2.05431_rt,-0.610059_rt,0.0354011_rt},
        {-2.47467_rt,2.04557_rt,-0.604408_rt,0.0343687_rt},
        {-2.47053_rt,2.03682_rt,-0.598764_rt,0.0333446_rt},
        {-2.46637_rt,2.02805_rt,-0.593129_rt,0.0323286_rt},
        {-2.4622_rt,2.01927_rt,-0.587503_rt,0.0313207_rt},
        {-2.45802_rt,2.01047_rt,-0.581886_rt,0.0303211_rt},
        {-2.45381_rt,2.00167_rt,-0.576277_rt,0.0293296_rt},
        {-2.4496_rt,1.99285_rt,-0.570678_rt,0.0283464_rt},
        {-2.44537_rt,1.98401_rt,-0.565088_rt,0.0273714_rt},
        {-2.44112_rt,1.97516_rt,-0.559506_rt,0.0264046_rt},
        {-2.43686_rt,1.9663_rt,-0.553934_rt,0.0254461_rt},
        {-2.43259_rt,1.95742_rt,-0.548372_rt,0.0244959_rt},
        {-2.4283_rt,1.94853_rt,-0.542818_rt,0.0235539_rt},
        {-2.424_rt,1.93963_rt,-0.537274_rt,0.0226202_rt},
        {-2.41968_rt,1.93072_rt,-0.53174_rt,0.0216949_rt},
        {-2.41534_rt,1.92179_rt,-0.526216_rt,0.0207778_rt},
        {-2.411_rt,1.91284_rt,-0.520701_rt,0.0198692_rt},
        {-2.40663_rt,1.90389_rt,-0.515196_rt,0.0189689_rt},
        {-2.40225_rt,1.89492_rt,-0.5097_rt,0.0180771_rt},
        {-2.39786_rt,1.88594_rt,-0.504215_rt,0.0171938_rt},
        {-2.39345_rt,1.87694_rt,-0.49874_rt,0.0163189_rt},
        {-2.38903_rt,1.86793_rt,-0.493276_rt,0.0154526_rt},
        {-2.38459_rt,1.85891_rt,-0.487822_rt,0.0145948_rt},
        {-2.38014_rt,1.84988_rt,-0.482378_rt,0.0137456_rt},
        {-2.37567_rt,1.84083_rt,-0.476946_rt,0.0129052_rt},
        {-2.37119_rt,1.83177_rt,-0.471524_rt,0.0120734_rt},
        {-2.36669_rt,1.8227_rt,-0.466113_rt,0.0112504_rt},
        {-2.36217_rt,1.81361_rt,-0.460713_rt,0.0104362_rt},
        {-2.35764_rt,1.80451_rt,-0.455325_rt,0.00963088_rt},
        {-2.3531_rt,1.7954_rt,-0.449949_rt,0.0088345_rt},
        {-2.34854_rt,1.78628_rt,-0.444584_rt,0.00804712_rt},
        {-2.34396_rt,1.77714_rt,-0.439231_rt,0.00726881_rt},
        {-2.33937_rt,1.768_rt,-0.43389_rt,0.00649963_rt},
        {-2.33476_rt,1.75884_rt,-0.428562_rt,0.00573964_rt},
        {-2.33014_rt,1.74966_rt,-0.423246_rt,0.00498893_rt},
        {-2.3255_rt,1.74048_rt,-0.417943_rt,0.00424756_rt},
        {-2.32085_rt,1.73128_rt,-0.412654_rt,0.00351561_rt},
        {-2.31618_rt,1.72208_rt,-0.407377_rt,0.00279317_rt},
        {-2.31149_rt,1.71286_rt,-0.402114_rt,0.0020803_rt},
        {-2.30679_rt,1.70363_rt,-0.396865_rt,0.00137709_rt},
        {-2.30207_rt,1.69438_rt,-0.391629_rt,0.000683629_rt},
        {-2.30207_rt,1.69438_rt,-0.391629_rt,0.000683629_rt}
    };

} //namespace warpx

} //namespace nci_godfrey

#endif // #ifndef WARPX_GODFREY_COEFF_TABLE_H_
